﻿
using Mango.Communication;
using System.Net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Blackbird.Utilities.Plugin;

namespace Blackbird
{
    /*
     * Project Blackbird - The revival
     * Copyright <C> 2012 - Adil Hafeez
     * Licensed under the Ms-Pl OSS license. <http://www.opensource.org/licenses/ms-pl>
     * http://mmoscene.net
     * Credits:
     * Zak - General help
     * Matty - Socket system
     */


    /// <summary>
    /// The main entry class for Blackbird.
    /// </summary>
    class Blackbird
    {

        private static ServerSocket GetSocket;
        
        public static void Main(String[] args)
        {
            Console.SetBufferSize(700, 400);
            
            Console.WriteLine("Project Blackbird is initializing...");


            


            int ServerMaxConnections = 100;

            ServerSocketSettings settings = new ServerSocketSettings
            {
                MaxConnections = ServerMaxConnections,
                NumOfSaeaForRec = ServerMaxConnections,
                NumOfSaeaForSend = ServerMaxConnections * 2,
                Backlog = 50,
                MaxSimultaneousAcceptOps = 15,
                BufferSize = 512,
                Endpoint = new IPEndPoint(IPAddress.Any, 90)
            };

          GetSocket = new ServerSocket(settings);


            GetSocket.Init();
            GetSocket.StartListen();

            Console.Read();

        }

        /// <summary>
        /// Get the server socket instance.
        /// </summary>
        /// <returns>Return a singleton of the server socket.</returns>
        public static ServerSocket GetSocketInstance()
        {
            return Blackbird.GetSocket;
        }

      
      
    }
}
